import { createRouter, createWebHistory } from "vue-router";


const Login = () => import('../views/Login.vue')

const user = () => import("../views/user/index.vue")
const userProfile = () => import("../views/user/Profile.vue")
const userSettings = () => import("../views/user/Settings.vue")

const routes = [
    {
        path: '/',
        redirect:'/login'
    },
    {
        path: '/login',
        name: 'login',
        component: Login
    },
    {
        path: '/user',
        name: 'user',
        component: user,
        redirect: '/user/profile',
        children: [
            {
                path: 'profile',
                name: 'profile',
                component: userProfile
            },
            {
                path: 'settings',
                name: 'settings',
                component: userSettings
            },
        ]
    }
]
   


const router = createRouter({
    history: createWebHistory(),
    routes,
});

export default router